import 'ni_geopoint_model.dart';

/// mapView属性集合
class NIMapOptions {
  ///是否显示地图自带的放大缩小按钮
  final bool showZoomControl;

  ///是否显示地图自带的指南针按钮
  final bool showCompassControl;

  /// 地图比例尺初始级别
  final int zoomLevel;

  /// 初始显示坐标
  NIGeoPoint? coordinate;

  /// NIMapOptions构造方法
  NIMapOptions({
    this.showCompassControl = true,
    this.showZoomControl = true,
    this.zoomLevel = 13,
    this.coordinate,
  }) {
    coordinate ??= NIGeoPoint(latitude: 39.907375, longitude: 116.391349);
  }

  String toJson() {
    return '{'
        '"showZoomControl":$showZoomControl,'
        '"showCompassControl":$showCompassControl,'
        '"zoomLevel":$zoomLevel,'
        '"coordinate":${coordinate?.toJson()}'
        '}';
  }
}
